Skip to content

BridgeJS: Escape reserved words in exported function parameters - #822

Merged
krodak merged 2 commits into
swiftwasm:mainfrom
wfltaylor:escape-reserved-parameter-names
Oct 29, 2026
Merged

krodak merged 2 commits into
swiftwasm:mainfrom
wfltaylor:escape-reserved-parameter-names

Conversation

@wfltaylor

Copy link
Copy Markdown
Contributor

Currently parameter names using reserved words, such as extension or break, generate invalid Swift and/or JS. Reserved words are now escaped with backticks in Swift and with a leading underscore in JS. Originally I removed the parameter names from the generated thunks entirely, just using param0 param1 etc., but this made the generated code harder to read.

Comment thread Plugins/BridgeJS/Sources/BridgeJSCore/ExportSwift.swift Outdated
Comment thread Plugins/BridgeJS/Sources/BridgeJSLink/BridgeJSLink.swift
@wfltaylor
wfltaylor requested a review from krodak October 28, 2026 05:13
@wfltaylor

Copy link
Copy Markdown
Contributor Author

@krodak thanks for the review, I’ve updated the PR

@krodak
krodak merged commit a0961dd into swiftwasm:main Oct 29, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants